import React from 'react'
import { NavBar, Cell } from '@nutui/nutui-react'
import { ArrowLeft } from '@nutui/icons-react'
import { useNavigate,useLocation } from 'react-router-dom'
import { ArrowRight, User } from '@nutui/icons-react'
// 账户与安全
export default function Account() {
  let navigate = useNavigate()
  const {state} = useLocation()
  console.log(state.user._id);
  
  return (
    <div>
      <NavBar
        back={
          <>
            <ArrowLeft />
          </>
        }
        onBackClick={(e) => navigate('/show/mine')}
      >账户安全</NavBar>

      <Cell
        className="nutui-cell-clickable"
        title="支付密码"
        align="center"
        extra={<ArrowRight />}
        onClick={()=>{navigate('/setpwd',{state:{_id:state.user._id,phone:state.user.phone}})}}
      />
      <Cell
        className="nutui-cell-clickable"
        title="更换手机号"
        align="center"
        extra={<ArrowRight />}
      />
      <Cell
        className="nutui-cell-clickable"
        title="修改密码"
        align="center"
        extra={<ArrowRight />}
        onClick={()=>{navigate('/changepaypwd',{state:{_id:state.user._id}})}}
      />
    </div>
  )
}
